<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./球体.css">
</head>

<body>
    <div class="wrap" id="ball1">
        <div class="x"></div>
        <div class="y"></div>
        <div class="z"></div>
    </div>
</body>
<script>
    var ball = document.getElementById("ball1");
    ball.style = "";
    window.onmousemove = function (event) {
        ball.style.top = event.pageY + "px";
        ball.style.left = event.pageX + "px";
    };
    window.onmousedown = function () {
        ball.style.animationDuration = "10s, 2s"
    }
    window.onmouseup = function () {
        ball.style.animationDuration = "10s, 4s"
    }
</script>

</html>